home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Magnum One
/
Magnum One (Mid-American Digital) (Disc Manufacturing).iso
/
d1
/
fff332.arc
/
GETCURD.C
< prev
next >
Wrap
C/C++ Source or Header
|
1990-04-07
|
961b
|
48 lines
/*----------------------------------------------------------------------*/
/* The main purpose for the routines in the module is to provide a */
/* degree of compatibility between Turbo C and Microsoft C. Turbo C */
/* provides a number of direct interfaces to MS-DOS/BIOS services that */
/* Mirosoft C does NOT provide. */
#include <stdio.h>
#if __TURBOC__
#include <dir.h>
#else
#include <dos.h>
#include <direct.h>
#endif
int
GetCurrentDirectory (int Disk, char *CurDir) {
#ifdef __TURBOC__
return(getcurdir(Disk + 1, CurDir));
#else
unsigned CurDrive, NumberOfDrives;
_dos_getdrive(&CurDrive);
_dos_setdrive(Disk + 1, &NumberOfDrives);
getcwd(CurDir - 3, 66);
_dos_setdrive(CurDrive, &NumberOfDrives);
return(0);
#endif
}
void
GetCurrentDisk (int *CurDisk) {
#ifdef __TURBOC__
*CurDisk = getdisk();
#else
int Temp;
_dos_getdrive(&Temp);
*CurDisk = Temp - 1;
#endif
}